package com.swallow.weixin.entity.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.swallow.weixin.enums.GlobalEnum;

import java.io.Serializable;

/**
 * @author swallow
 */
public class ResultVO implements Serializable {


    private static final long serialVersionUID = 1L;

    /**
     * 成功为 1
     */
    public final static int RESULT_SUCCESS = 0X01;

    /**
     * 失败为 0
     */
    public final static int RESULT_FAILED = 0X00;

    private Integer result;

    private Integer errorCode;

    private String message;

    private Object data;

    public ResultVO() {
        super();
    }

    public ResultVO(GlobalEnum globalEnum) {
        this.result = RESULT_FAILED;
        this.errorCode = globalEnum.getCode();
        this.message = globalEnum.getMessage();
    }

    public ResultVO(GlobalEnum globalEnum,String message) {
        this.result = RESULT_FAILED;
        this.errorCode = globalEnum.getCode();
        this.message = message;
    }

    public ResultVO(Integer result, Integer errorCode, String message, Object data) {
        this.result = result;
        this.errorCode = errorCode;
        this.message = message;
        this.data = data;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
